﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Jumpton.SFA.Server.BusinessRule.MasterData;
using Jumpton.SFA.Server.BusinessRule;
using Jumpton.SFA.Server.BusinessRule.System;

public partial class EmployeeData_ThirdPartyPersonList : PageBase
{
    private String orgID;
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            BindData();
            link.NavigateUrl += "?" + Request.QueryString.ToString();
        }
    }

    private void BindData()
    {
        GridView1.ShowHeader = true;
        GridView1.ShowFooter = true;
        this.GridView1.UseAccessibleHeader = true;
        DataTable dt = PersonManager.SelectPERSONSsDynamic(null,null,null,MyStateManager.DomainID,Request.QueryString.ToString(),null, 2).Tables[0];
        GridView1.PreRender += new EventHandler(GridView1_PreRender);
        GridView1.DataSource = dt;
        GridView1.DataBind();
        GridView1.Attributes.Clear();
        GridView1.CssClass = "display stylized";
        
        HtmlGenericControl html = new HtmlGenericControl();
        html.TagName = "Script";
        html.InnerHtml =@"$(document).ready(function(){
	    Administry.setup();
    	$('#" +  GridView1.ClientID + @"').dataTable();
	    Administry.expandableRows();
        });";
        html.Attributes.Add("type", "text/javascript");
        Controls.Add(html);


    }

    void GridView1_PreRender(object sender, EventArgs e)
    {
        if (this.GridView1.Rows.Count > 0)
        {
            //设置thead下的td替换成th
            
            
            //加入<thead>与<tbody>
            this.GridView1.HeaderRow.TableSection = TableRowSection.TableHeader;
            //加入<tfoot>
            this.GridView1.FooterRow.TableSection = TableRowSection.TableFooter;
        }

    }
}